import request from './request.js';
//字典
export function getdict(data) {
	return request({
		url: `/system/dict/data/type/${data}`,
		method: 'get',
	})
}
//文件上传
export function fileUpload(data) {
	return request({
		url: '/common/upload',
		method: 'POST',
		data
	})
}

//临时token
export function loginToken(data) {
	return request({
		url: '/merchant/login/ghost',
		method: 'POST',
		data
	})
}
//商家入驻
export function shopregister(data) {
	return request({
		url: '/merchant/login/register',
		method: 'POST',
		data
	})
}
//商家重新提交入驻
export function shopregisterTwo(data) {
	return request({
		url: '/merchant/user/update/register',
		method: 'POST',
		data
	})
}
// 获取验证码
export function getCode(data) {
	return request({
		url: '/sms/phone',
		method: 'POST',
		data
	})
}
// 验证码登录
export function getmerchantLogin(data) {
	return request({
		url: '/merchant/login/phone',
		method: 'POST',
		data
	})
}
//密码登录
export function getpwdLogin(data) {
	return request({
		url: '/merchant/login/phone/pwd',
		method: 'POST',
		data
	})
}
//修改密码：
export function setPassword(data) {
	return request({
		url: '/merchant/user/update/pwd',
		method: 'POST',
		data
	})
}
// 商家信息
export function getShopinfo(data) {
	return request({
		url: '/merchant/user/info',
		method: 'POST',
		data
	})
}
// 修改商家信息
export function editShopinfo(data) {
	return request({
		url: '/merchant/user/edit',
		method: 'POST',
		data
	})
}
//商品列表
export function getProductList(data) {
	return request({
		url: '/merchant/product/list',
		method: 'POST',
		data
	})
}
//商品详情
export function getProductInfo(data) {
	return request({
		url: '/merchant/product/info',
		method: 'POST',
		data
	})
}
//添加商品：
export function addProduct(data) {
	return request({
		url: '/merchant/product/add',
		method: 'POST',
		data
	})
}
//添加商品：
export function productCategory(data) {
	return request({
		url: '/merchant/user/category',
		method: 'POST',
		data
	})
}

//编辑商品：
export function editProduct(data) {
	return request({
		url: '/merchant/product/edit',
		method: 'POST',
		data
	})
}
//删除商品
export function removeProduct(data) {
	return request({
		url: '/merchant/product/remove',
		method: 'POST',
		data
	})
}
//商品上架/下架
export function updateProduct(data) {
	return request({
		url: '/merchant/product/update/status',
		method: 'POST',
		data
	})
}
//更新库存：
export function changeProductCount(data) {
	return request({
		url: '/merchant/product/count/change/count',
		method: 'POST',
		data
	})
}
//下拉选择商品：
export function selectProduct(data) {
	return request({
		url: '/merchant/product/all',
		method: 'POST',
		data
	})
}
//库存列表
export function merchantList(data) {
	return request({
		url: '/merchant/product/count/list',
		method: 'POST',
		data
	})
}



//数量统计：
export function getOrdersCount(data) {
	return request({
		url: '/merchant/orders/sum/count',
		method: 'POST',
		data
	})
}

//金额统计
export function getOrdersAmount(data) {
	return request({
		url: '/merchant/orders/sum/amount',
		method: 'POST',
		data
	})
}
//待取餐
export function getAmountList(data) {
	return request({
		url: '/merchant/orders/take/list',
		method: 'POST',
		data
	})
}

//订单列表
export function ordersList(data) {
	return request({
		url: '/merchant/orders/list',
		method: 'POST',
		data
	})
}
// 营业数据
export function ordersStatistic(data) {
	return request({
		url: '/merchant/orders/statistic',
		method: 'POST',
		data
	})
}

//订单详情：
export function ordersInfo(data) {
	return request({
		url: '/merchant/orders/info',
		method: 'POST',
		data
	})
}
//订单核销：
export function ordersTake(data) {
	return request({
		url: '/merchant/orders/take',
		method: 'POST',
		data
	})
}
//订单取消(退款)：
export function ordersRefund(data) {
	return request({
		url: '/merchant/orders/refund',
		method: 'POST',
		data
	})
}

// 标签数量
export function tagList(data) {
	return request({
		url: '/merchant/comment/tag/list',
		method: 'POST',
		data
	})
}
// 评论列表
export function commentList(data) {
	return request({
		url: '/merchant/comment/list',
		method: 'POST',
		data
	})
}
// 评论详情
export function commentInfo(data) {
	return request({
		url: '/merchant/comment/info',
		method: 'POST',
		data
	})
}
// 回复列表
export function commentReplyList(data) {
	return request({
		url: '/merchant/comment/reply/list',
		method: 'POST',
		data
	})
}
//  商家回复
export function commentReplyadd(data) {
	return request({
		url: '/merchant/comment/reply/add',
		method: 'POST',
		data
	})
}


//协议相关
export function queryAgreement(data) {
	return request({
		url: `/sys/text/query/${data}`,
		method: 'get',
	})
}
//商家余额：
export function money1(data) {
	return request({
		url: '/merchant/user/data/amount',
		method: 'POST',
		data
	})
}
//今日营业额：
export function money2(data) {
	return request({
		url: '/merchant/user/data/today',
		method: 'POST',
		data
	})
}
//在途金额：
export function money3(data) {
	return request({
		url: '/merchant/user/data/way',
		method: 'POST',
		data
	})
}
//商家分账列表：
export function separateList(data) {
	return request({
		url: '/merchant/user/separate/list',
		method: 'POST',
		data
	})
}
//商家分账列表：
export function separateData(data) {
	return request({
		url: '/merchant/user/separate/data',
		method: 'POST',
		data
	})
}
//

export function separateInfo(data) {
	return request({
		url: '/merchant/user/separate/info',
		method: 'POST',
		data
	})
}
export function drawApply(data) {
	return request({
		url: '/merchant/user/draw/apply',
		method: 'POST',
		data
	})
}
export function drawApplyList(data) {
	return request({
		url: '/merchant/user/draw/list',
		method: 'POST',
		data
	})
}

export function shopmer(data) {
	return request({
		url: '/merchant/user/shop/mer',
		method: 'POST',
		data
	})
}
